import torch
from torch import nn
from torch.nn import functional as F
import torchvision
layer = nn.Conv2d(3, 16, kernel_size=3, stride=1, padding=0)
layer1 = nn.Conv2d(3, 16, kernel_size=3, stride=1, padding=1)

layer3 = nn.MaxPool2d(2, stride=1)
layer4 = nn.ReLU(inplace=True)
data = torch.randn(128, 3, 28, 28)
print(data.shape)

out = layer(data)
print(out.shape)

out1 = layer1(data)
print(out1.shape)

out2 = layer2(data)
print('layer2:', out2.shape)

out3 = layer3(data)
print('layer3:',out3.shape)

print(F.avg_pool2d(data, 2, stride=2).shape)

print(F.interpolate(data, scale_factor=2, mode='nearest').shape)

out4 = layer4(data)
print(out4.shape)



# train_Data = torchvision.datasets.CIFAR100('cifar100', True, download=True, transform=torchvision.transforms.Compose([
#     torchvision.transforms.ToTensor(),
# ]))
# test_Data = torchvision.datasets.CIFAR100('cifar100', True, download=True, transform=torchvision.transforms.Compose([
#     torchvision.transforms.ToTensor(),
# ]))

